<%--
  Created by IntelliJ IDEA.
  User: Administrator 发布就业问卷
  Date: 2016/10/13
  Time: 1:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";%>
<html>
<head>
  <base href="<%=basePath%>">
  <meta charset="utf-8"/>
  <title></title>
  <link rel="stylesheet" type="text/css" href="easyui-1.4/themes/default/easyui.css">
  <link rel="stylesheet" type="text/css" href="easyui-1.4/themes/icon.css">
  <link rel="stylesheet" type="text/css" href="easyui-1.4/demo/demo.css">
  <script type="text/javascript" src="easyui-1.4/jquery.min.js"></script>
  <script type="text/javascript" src="easyui-1.4/jquery.easyui.min.js"></script>
</head>
<body>
<div class="row">
  <div class="col-md-12">
    <!-- BEGIN PAGE TITLE & BREADCRUMB-->
    <h3 class="page-title" id="index-page-title" style="font: normal 30px/0.8em '微软雅黑'">孜点教科</h3>
    <ul class="page-breadcrumb breadcrumb">
      <%--<li>
        <i class="fa fa-home"></i>
        首页
        <i class="fa fa-angle-right"></i>
      </li>--%>
      <li>
        <%--<a href="javascript:;">--%>
        问卷管理
        <%--</a>--%>
        <i class="fa fa-angle-right"></i>
      </li>
      <li>
        <%--<a href="javascript:;">--%>
        发布就业问卷
        <%--</a>--%>
      </li>
    </ul>
    <!-- END PAGE TITLE & BREADCRUMB-->
  </div>
</div>
<div style="margin:20px 0;"></div>
<div style="width:480px;margin: 0 auto;margin-top: 20px;">
    <div class="easyui-panel" title="发布就业问卷" style="width:480px">
  <div style="padding:0px 40px 20px 40px">
    <form id="ff" class="easyui-form" method="post" data-options="novalidate:true">

      <table cellpadding="5" id="xx">
        <tr>
          <td><input type="hidden" value="${user.teacherid}" name="publisherId"><input type="hidden" value="就业" name="questionnaireExplain" style="width:300px;height:30px; border:1px solid #d6dde5;background-color:transparent;padding:0px 10px;"></td>
        </tr>
        <tr>
          <td>问卷标题:</td>
          <td><input class="easyui-validatebox textbox" type="text" name="questionnaireTitle" data-options='required:true' style="width:300px;height:30px; border:1px solid #d6dde5;background-color:transparent;padding:0px 10px;" /></td>
          <%--value=<%=templateTitle%>--%>
        </tr>
        <tr>
          <td>具体对象:</td>
          　　<td><input class="easyui-validatebox textbox" type="text" name="releaseToWho" data-options='required:true' value="请输入具体发布的班级"  style="width:300px;height:30px; border:1px solid #d6dde5;background-color:transparent;padding:0px 10px;"/></td>
        </tr>
        <tr>
          <td>就业问卷链接:</td>
          <td><input class="easyui-validatebox textbox" type="text" name="questionnaireURL" data-options='required:true' style="width:300px;height:30px; border:1px solid #d6dde5;background-color:transparent;padding:0px 10px;" /></td>
          <%--<select id="sel" onChange="chg()"class="easyui-combobox" name="publishObjects" data-options='required:true' style="width:200px;" value=<%=publishObjects%> >--%>
          <%--<option value="课程">课程</option>--%>
          <%--<option value="班级">班级</option>--%>
          <%--</select>--%>
          <%--publishObjects value=<%=publishObjects%>--%>
        </tr>
      </table>
    </form>
    <div style="text-align:center;padding:5px;margin-top: 10px;">
      <a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()" style="width:105px;height:30px;">确认</a>
      <a href="javascript:void(0)" class="easyui-linkbutton" onclick="clearForm()" style="width:105px;height:30px;">取消</a>
    </div>
  </div>
</div>
</div>
</body>

<script>
  function submitForm() {
    $('#ff').form('submit', {
      url : 'rest/EmploymentQuestionnaire/publishEmployment',
      onSubmit: function () {
        return $(this).form('enableValidation').form('validate');
      },
      success : function(data){
        var obj = JSON.parse(data)
        if(obj.code == 200){
          $.messager.show({title:'操作提示',msg:obj.message,showType:'show',style: {
            top:($(window).height()-200) * 0.5,
            left:($(window).width() -250) * 0.5
          }});
        }else{
          $.messager.show({title:'操作提示',msg:obj.message,showType:'show',style: {
            top:($(window).height()-200) * 0.5,
            left:($(window).width() -250) * 0.5
          }});
        }
        $('#ff').form('clear');
      }
    });
  }
  function clearForm() {
    $('#ff').form('clear');
  }

</script>
</html>
